//
//  JSONMappedObject.h
//  oos4ios
//
//  Created by Pablo Gonzalez on 7/22/11.
//  Copyright 2011 11870.com. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef enum {
    setter, adder, remover, getter
} SelectorType;

@interface SelectorDescriptor : NSObject {

    SelectorType type;
    NSString *name;
    
}

@property (nonatomic, retain) NSString *name;
@property (nonatomic) SelectorType type;

+ (SelectorDescriptor *) descriptorForString: (NSString *) fullname;
+ (SelectorDescriptor *) descriptorForSelector: (SEL) aSelector;

@end

@class JSONMappedObject;

@interface JSONMappedObjectRelationship : NSObject {

    Class mObjectClass;
    BOOL mToMany;
    
}

@property (nonatomic, retain) Class objectClass;
@property (nonatomic) BOOL toMany;

@end

@interface JSONMappedObject : NSObject {
    
    NSDictionary *pathDictionary;
    NSArray *keys;
    NSString *jsonString;
    NSDictionary *jsonObject;
    
}

#pragma mark - data description

- (NSDictionary *) pathDictionary;
- (NSArray *) indexes;
- (NSArray *) relationships;

#pragma mark - initializers

- (id) initWithJson: (NSString *) json;
+ (id) objectWithJson: (NSString *) json;

@end
